package file;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-06-21
 * Time: 19:26
 */

// 利用 Scanner 进行字符读取
public class Demo13 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("F:/测试/test.txt")){
            Scanner sc  = new Scanner(inputStream,"utf-8");
            while (sc.hasNext()){
                String str = sc.next();
                System.out.println(str);
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
